import React, {Component} from 'react'
import {View, Text} from 'react-native'

class MovieDetail extends Component{
    //
    // constructor(props){
    //     super(props)
    //     this.updateTitleBar()
    // }

    static navigationOptions = ({navigation}) =>{
        const { params } = navigation.state;
        return{
            title: params ? params.title:'电影详情'
            // headerStyle:{
            //     backgroundColor:navigationOptions.headerStyle.backgroundColor
            // },
            //
            // headerTintColor:navigationOptions.headerTintColor
        }
    }

    render(){
        const { params } = this.props.navigation.state;
        const movie_title = params? params.title:null;

        return(

            // this.props.navigation.setParams({otherParam:'${JSON.stringify(movie_title)}'}),

            <View style={{flex:1, justifyContent:'center', alignItems:'center'}}>
                <Text style={{fontSize:16, color:'#000'}}>{JSON.stringify(movie_title)}</Text>
            </View>
        )
    }
}

export {MovieDetail as default}